/**
 * 子模块service
 * DHpai
 */
var service = function($resource, $q, $state, $modal){
 
    //参数转换
	var str2Data = function(str, item) {
		item['day' + str.substring(0, 1)] = str.substring(2);
    }

    //删除str1中与str2相同的部分,如果str1中包含多个str2则只删除第一个出现的
	var deleteStr = function(str1, str2) {
		var index = str1.indexOf(str2);
		if(index == -1){
			return str1;
		}
		return str1.substring(0, index) + str1.substring(index + str2.length + 1);
	}
    
    return {
        str2Data : function(){
            return str2Data;
        },
        deleteStr : function(){
            return deleteStr;
        }
    };

};

module.exports = service;